/**
 * SymtabEntry contains both type and value for a program variable or
 * condition id or event id.  
 * Condition id or event id has a special type "_macType" which 
 * indicates a value field of the id is a pointer to the subtree of
 * condition or event definition. 
 *
 * If a variable is an execution point like <code> Gate.gd()</code>, 
 * a value field of the symbol entry of the variable is null 
 * or directives like <code> start </code> or <code> end </code>.
 */ 
package mac.types.parserTypes;

import java.util.*;

public class SymtabEntry implements java.io.Serializable {
  protected String type;
  protected Object value;
  protected Object oldValue;
  protected boolean updated;

  public SymtabEntry() { type = ""; value = null; }
  public SymtabEntry(String t) { type = t; value = null; }
  public SymtabEntry(String t, Object v) { type = t; value = v; }

  public String getType() { return type; }
  public Object getValue() { return value; }
  public Object getOldValue() { return oldValue; }
  public void setType(String t) { type = t; }
  public void setValue(Object v) { value = v; }
  public void setOldValue(Object v) { oldValue = v; }

  /** This method shows whether update of this variable(program variables or
   * exec points)
   * happens or not.  */
  public boolean isUpdated() { return updated;} 
  /** This method sets a flag of updation of a variable */
  public void setUpdated() { updated = true;} 
  /** This method resets a flag of updation of a variable */
  public void resetUpdated() { updated = false;} 

/*  public String toString() {
      String s = null;
      s = type + ":"+ value +":" + updated; 
      return s;
  }
  */
}
